<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.turing.post.webservice.client.CardHolderUser"%>
<%@page import="com.turing.selfwebservice.common.Toolkit"%>
<%@page import="com.turing.post.webservice.client.CardHolderUserLink"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>" />
		<title>用户关联卡信息</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="<%=path %>/css/c.css" rel="stylesheet" type="text/css" />
		<link
			href="<%=path %>/js/plugs/ui/css/south-street/jquery-ui-1.9.2.custom.min.css"
			rel="stylesheet" type="text/css" />
		<link href="<%=path %>/js/plugs/fancybox/jquery.fancybox-1.3.4.css"
			rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="<%=path %>/js/jquery.js">
</script>
		<script type="text/javascript"
			src="<%=path %>/js/plugs/fancybox/jquery.fancybox-1.3.4.pack.js">
</script>
		<script type="text/javascript"
			src="<%=path %>/cardholderuser/cardHolderUserLinkIndex.js">
</script>
		<script type="text/javascript"
			src="<%=path %>/js/plugs/ui/jquery-ui-1.9.2.custom.min.js">
</script>
		<script type="text/javascript" src="<%=path %>/js/cdatePicker.js">
</script>
		<script type="text/javascript" src="<%=path %>/js/base.js">
</script>
		<script type="text/javascript" src="<%=path %>/js/common.js">
</script>
		<script type="text/javascript" src="<%=path %>/js/cardHolderUserLinkIndex.js">
</script>
		<script type="text/javascript" src="<%=basePath%>js/WdatePicker.js">
		</script>

		<script type="text/javascript" src="<%=path %>/cardholderuser/cardholderuser.js">
</script>
		<script type="text/javascript" src="<%=path %>/js/plugs/Validform_v5.3_min.js">
</script>

		<script>
var basePath = "<%=basePath%>";
$(document).ready(function() {
	$("#expired").cdatePicker( {
		selectIconSrc : "<%=path %>/images/datepicker.png"
	});
});
</script>
	</head>
	<%
		CardHolderUser user = (CardHolderUser) request
				.getAttribute("CardHolderUser");
		List<CardHolderUserLink> CardHolderUserLinks = (List<CardHolderUserLink>) request
				.getAttribute("CardHolderUserLinks");
	%>
	<%
		Object obj = request.getAttribute("ReturnMsg");
		String ReturnMsg = obj == null ? "" : obj.toString();
		if (null != ReturnMsg && !"".equals(ReturnMsg)) {
	%>
	<script type="text/javascript">
alert("<%=ReturnMsg%>");
</script>
	<%
		}
	%>
	<body>
		<table width="100%" border="1" align="center" cellpadding="0"
			cellspacing="0">
			<tr>
				<td colspan="4">
					持卡用户基本信息
				</td>
			</tr>
			<tr>
				<td width="20%">
					登录名：
				</td>
				<td width="30%">
					<%=Toolkit.dealNull(user.getLogonName())%>
				</td>
				<td width="20%">
					姓名：
				</td>
				<td width="30%">
					<%=Toolkit.dealNull(user.getName())%>
				</td>
			</tr>
			<tr>
				<td>
					邮箱：
				</td>
				<td>
					<%=Toolkit.dealNull(user.getEmail())%>
				</td>
				<td>
					联系电话：
				</td>
				<td>
					<%=Toolkit.dealNull(user.getLinkTele())%>
				</td>
			</tr>
			<tr>
				<td>
					证件号：
				</td>
				<td>
					<%=Toolkit.dealNull(user.getIdNo())%>
				</td>
				<td>
					联系地址：
				</td>
				<td>
					<%=Toolkit.dealNull(user.getAddr())%>
				</td>
			</tr>
			<tr>
				<td colspan="4" class="optionTd">
					<span style="cursor: pointer; color: blue; float: right;"
						id="addLinkCardButton" fancyTo="AddCardHolderUserLink"
						fancyOptions="width:390px;">添加关联卡</span> 持卡用户关联卡信息
				</td>
			</tr>
			<%
				int i = 0;
				for (CardHolderUserLink link : CardHolderUserLinks) {
					i++;
			%>
			<tr>
				<td colspan="2">
					<span align="right" id="balanceDiv<%=i%>"
						style="display: none; float: rihgt;"></span>
					<%=link.getCardNo()%>
				</td>
				<td colspan="2" class="optionTd">
					<span style="cursor: pointer; color: blue;"
						onclick="showBalance('balanceDiv<%=i%>','<%=link.getCardNo()%>');">卡余额</span>&nbsp;
					<span style="cursor: pointer; color: blue;"
						onclick="do_query_activeCardInfo('<%=link.getCardNo()%>');"
						fancyTo="CardExtendExpired"
						fancyOptions="cacheOpen:true;width:560px;">卡延期</span>&nbsp;
					<span style="cursor: pointer; color: blue;"
						onclick="cardClassicChange_Info('<%=link.getCardNo()%>');"
						fancyTo="CardClassicChange" fancyOptions="cacheOpen:true;">变更卡种类</span>&nbsp;
					<span style="cursor: pointer; color: blue;"
						onclick="ChangeCardPassword('<%=link.getCardNo()%>');"
						fancyTo="ChangeCardPasswordDiv" fancyOptions="width:460px;">卡改密</span>
					<span style="cursor: pointer; color: blue;"
						onclick="CardTemporaryLoss('<%=link.getCardNo()%>');"
						fancyTo="CardTemporaryLossDiv" fancyOptions="width:460px;">卡临时挂失</span>
					<span style="cursor: pointer; color: blue;"
						onclick="location.href='<%=basePath%>cardHolderUserServlet.do?method=CardTradDetail&cardNo=<%=link.getCardNo()%>';">卡交易明细</span>
					<span style="cursor: pointer; color: blue;"
						onclick="cancelCardHolderUserLink('<%=link.getCardNo()%>');">取消关联</span>
				</td>
			</tr>
			<%
				}
			%>
		</table>
		<span style="color: red" id="returnString"></span>
		<!-- 卡延期 -->
		<div id="CardExtendExpired">
			<form method="post">
				<table align="center" cellPadding="0" cellSpacing="0" border="1"
					class="tableForm" width="95%">
					<tr>
						<td colspan="4">
							<img src="<%=path%>/images/sign.png" />&nbsp;
							&nbsp;卡基本信息
						</td>
					</tr>
					<tr>
						<td width="18%">
							卡号:
						</td>
						<td id=secTable width="29%">
							<span id="ceeCardNo"></span>
						</td>
						<td width="15%">
							卡片种类:
						</td>
						<td id=secTable width="38%">
							<span id="cardClassicName"></span>
						</td>
					</tr>
					<tr>
						<td width="18%">
							当前余额:
						</td>
						<td id=secTable>
							<span id="balance"></span>
						</td>
						<td id=secTable>
							有效期:
						</td>
						<td id=secTable>
							<input type="text" id="expired" size="30" readonly="readonly"
								style="width: 100px;" name="expired" />
						</td>
					</tr>
					<tr>
						<td colspan="4">
							<img src="<%=path%>/images/sign.png" />
							手续费回执信息
						</td>
					</tr>
					<tr>
						<td width="18%">
							手续费:
						</td>
						<td id=secTable colspan="3">
							<span id="ceeFee" style="color: red"></span>
						</td>
					</tr>
					<tr>
						<td width="18%">
							备注:
						</td>
						<td id=secTable colspan="3">
							<textarea rows="5" cols="50" id="remark" name="remark"></textarea>
						</td>
					</tr>
					<tr>
						<td style="text-align: center" id=secTable colspan="4">
							<a plain="false" iconCls="icon-save"
								onClick="do_CardExtendExpired(true);">延期试算</a>&nbsp;&nbsp;&nbsp;&nbsp;
							<a plain="false" iconCls="icon-save"
								onClick="do_CardExtendExpired(false);">确认延期</a>
						</td>
					</tr>
				</table>
			</form>
		</div>
		<!-- 卡延期结束 -->
		<!-- 变更卡种类 -->
		<div style="padding-bottom: 5px; display: none;"
			id="CardClassicChange">
			<form method="post" id="CardClassicChangeForm">
				<table align="center" cellPadding="0" cellSpacing="0" border="1"
					class="tableForm" width="95%">
					<tr>
						<td colspan="4">
							<img src="<%=path%>/images/sign.png" />
							&nbsp;卡基本信息
						</td>
					</tr>
					<tr>
						<td width="19%">
							卡号：
						</td>
						<td width="20%">
							<span id="cccCardNo"></span>
						</td>
						<td width="20%">
							原卡种类：
						</td>
						<td id=secTable width="43%">
							<span id="idTypeName"></span>
							<input type="hidden" id="fromCardClassicId"
								name="fromCardClassicId" />
							<span id="fromCardClassicName"></span>

						</td>
					</tr>
					<tr>
						<td width="19%">
							目标卡种类：
						</td>
						<td>
							<select id="toCardClassicId" name="toCardClassicId"></select>
						</td>
						<td>
							卡当前余额：
						</td>
						<td>
							<span id="oldBalance"></span>
						</td>
					</tr>
					<tr>
						<td width="19%">
							密码：
						</td>
						<td colspan="3">
							<input type="password" id="password" name="password"
								class="easyui-validatebox" required
								validType="minLength['密码',8,8]" />
						</td>
					</tr>
					<tr>
						<td width="19%">
							原因备注：
						</td>
						<td colspan="3">
							<textarea rows="5" cols="50" id="ccRemark" name="ccRemark"></textarea>
						</td>
					</tr>
					<tr>
						<td colspan="4">
							<img src="<%=path%>/images/sign.png" />
							&nbsp;交易返回信息
						</td>
					</tr>
					<tr>
						<td width="19%">
							手续费:
						</td>
						<td id=secTable colspan="3">
							<span id="cccFee" style="color: red"></span>
						</td>
					</tr>
					<tr>
						<td colspan="4" style="text-align: center;">
							<a href="javascript:void(0)" onClick="doCardClassicChange(true)"
								id="btn-save" icon="icon-ok">试算变更</a>
							<a href="javascript:void(0)" onClick="doCardClassicChange(false)"
								id="btn-save" icon="icon-ok">确认变更</a>
						</td>
					</tr>
				</table>
			</form>
		</div>
		<!-- 变更卡种类结束 -->
		<!-- 卡改密开始 -->
		<div id="ChangeCardPasswordDiv" style="display: none;">
			<form id="CardChange" method="post">
				<table align="center" cellPadding="0" cellSpacing="0" border="1"
					width="95%">
					<tr>
						<td colspan="2">
							<img src="<%=path%>/images/sign.png" />
							&nbsp;卡改密
						</td>
					</tr>
					<tr>
						<td width="30%" align="right">
							卡号：
						</td>
						<td width="70%">
							<span id="ccpCardNo"></span>
						</td>
					</tr>
					<tr>
						<td width="30%" align="right">
							旧密码：
						</td>
						<td>
							<input type="password" name="oldCardPwd" id="oldCardPwd"
								datatype="*" errormsg="密码不能为空!" />
						</td>
					</tr>
					<tr>
						<td align="right">
							新密码：
						</td>
						<td>
							<input type="password" name="newCardPwd" id="newCardPwd"
								datatype="s6-30" errormsg="密码长度不够!" />
						</td>
					</tr>
					<tr>
						<td align="right">
							新密码确认：
						</td>
						<td>
							<input type="password" name="newCardPwd2" id="newCardPwd2"
								datatype="*" recheck="newCardPwd" nullmsg="请再输入一次密码!"
								errormsg="输入的密码不一致!" />
						</td>
					</tr>
					<tr>
						<td align="right">
							备注：
						</td>
						<td>
							<textarea name="ccpRemark" id="ccpRemark" cols="45" rows="5"></textarea>
						</td>
					</tr>
					<tr>
						<td colspan="2" align="center">
							<a iconCls="icon-save" onClick="do_ChangeCardPassword();">修改密码</a>
						</td>
					</tr>
				</table>
			</form>
		</div>
		<!-- 卡改密结束 -->

		<!-- 添加关联卡 -->
		<div id="AddCardHolderUserLink">
			<form id="AddCardHolderUser" method="post">
				<table border="1" cellpadding="0" cellspacing="0" width="95%">
					<tr>
						<td colspan="2">
							<img src="<%=path%>/images/sign.png" />
							&nbsp;添加关联卡
						</td>
					</tr>
					<tr>
						<td width="20%">
							卡号：
						</td>
						<td width="80%">
							<input type="text" id="addchulinkCardNo" name="addchulinkCardNo"
								style="width: 160px" datatype="n19-19" errormsg="卡号为19位有效卡!" />
						</td>
					</tr>
					<tr>
						<td>
							密码：
						</td>
						<td>
							<input type="password" id="addchulinkPwd" name="addchulinkPwd"
								style="width: 160px" datatype="s6-30" errormsg="密码长度不够!" />
						</td>
					</tr>
					<tr>
						<td colspan="2" align="center">
							<a plain="false" iconCls="icon-save"
								onclick="addCardHoldUserLink();">提交</a>
						</td>
					</tr>
				</table>
			</form>
		</div>
		<!-- 添加关联卡结束 -->
		<!-- 卡临时挂失 -->
		<div id="CardTemporaryLossDiv">
			<table border="1" cellpadding="0" cellspacing="0" width="95%">
				<tr>
					<td colspan="2">
						<img src="<%=path%>/images/sign.png" />
							&nbsp;卡临时挂失
					</td>
				</tr>
				<tr>
					<td width="20%">
						卡号：
					</td>
					<td width="80%">
						<span id="ctlCardNo"></span>
					</td>
				</tr>
				<tr>
					<td align="right">
						原因备注：
					</td>
					<td>
						<textarea name="ctlRemark" id="ctlRemark" cols="45" rows="5"></textarea>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="center">
						<a iconCls="icon-save" onClick="do_CardTemporaryLoss();">卡临时挂失</a>
					</td>
				</tr>
			</table>
		</div>
		<!-- 卡临时挂失结束 -->
	</body>
</html>
